﻿using System.Collections.Generic;
using OpenReflect.Common;
using OpenReflect.Domain.Contracts;
using OpenReflect.Domain.Contracts.Declarations;
using OpenReflect.Domain.Contracts.Generics;

namespace OpenReflect.Domain.Model.Declarations
{
	public class MethodDeclaration : IMethodDeclaration
	{
		public MethodDeclaration()
			: this(Accessor.Private, null, null, null)
		{
		}

		public MethodDeclaration(Accessor accessModifier, IParameterList parameterList)
			: this(accessModifier, parameterList, null, null)
		{
		}

		public MethodDeclaration(Accessor accessModifier, IParameterList parameterList,
		                         IList<IGenericArgument> genericArgumentList)
			: this(accessModifier, parameterList, genericArgumentList, null)
		{
		}

		public MethodDeclaration(Accessor accessModifier, IParameterList parameterList,
		                         IList<IGenericArgument> genericArgumentList, ITypeDeclaration returnType)
		{
			AccessModifier = accessModifier;
			ParameterList = parameterList;
			GenericArguments = genericArgumentList;
			ReturnType = returnType;
		}

		public IList<IGenericArgument> GenericArguments { get; private set; }

		#region IMethodDeclaration Members

		public Accessor AccessModifier { get; set; }

		public IParameterList ParameterList { get; private set; }

		public string Name { get; set; }

		public bool IsVirtual { get; set; }

		public bool IsAbstract { get; set; }

		public bool IsStatic { get; set; }


		public ITypeDeclaration ReturnType { get; private set; }

		#endregion
	}
}